SUBDIR =	owfilter owlogcoll owlogmon
SUBTARGET =	all clean cleancmake cleandir cleanlinks cleanobj includes install
CONF_FILES =	config.h

$(SUBTARGET):
	@echo "===> owfilter"
	cd owfilter && $(MAKE) $@
	@echo "===> owlogcoll"
	cd owlogcoll && $(MAKE) $@
	@echo "===> owlogmon"
	cd owlogmon && $(MAKE) $@

all: configure

configure: ${CONF_FILES}

# Autodetecting in config files
$(CONF_FILES): %: %.in
	cp $< $@

cleandir: cleanconf cleancmake

cleanconf:
	rm -f ${CONF_FILES}

cleancmake: cleancmakeglobal

cleancmakeglobal:
	@echo '===> (global)'
	cd $(CURDIR) && rm -f Makefile CMakeCache.txt cmake_install.cmake
	cd $(CURDIR) && rm -Rf CMakeFiles
